package com.chinatsp.onlineapp.ui.violation;

import java.util.ArrayList;
import java.util.List;

import tsp.cn.http.tools.T;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ImageView;

import com.chinatsp.onlineapp.R;
import com.chinatsp.onlineapp.base.BaseActivity;
import com.chinatsp.onlineapp.presenter.QueryViolationLogDao;
import com.chinatsp.onlineapp.ui.widget.HorizontalListView;

/**
 * 违章列表详情
 */
public class QueryViolationLogActivity extends BaseActivity implements
		View.OnClickListener {

	private ImageView ivBack;
	private ImageView ivRightRefresh;
	private QueryViolationLogDao queryViolationLogDao;
	private HorizontalListView hlv;

	@Override
	public void onRequestSuccess(int requestCode) {
		super.onRequestSuccess(requestCode);
		// 开始更新UI
		showProgress(false);
		
		
	}

	@Override
	public void onRequestFailed(String errorNo, String errorMessage) {
		super.onRequestFailed(errorNo, errorMessage);
		// 开始更新UI
		showProgress(false);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_query_violation_log);
		initView();
	}

	private void initView() {
		
		ivBack = (ImageView) findViewById(R.id.iv_back);
		ivRightRefresh = (ImageView) findViewById(R.id.iv_log_right_refresh);
		hlv = (HorizontalListView) findViewById(R.id.hlv);
		queryViolationLogDao = new QueryViolationLogDao(this, this);
		List list = new ArrayList<T>();
		
		ViolationLogAdapter adapter = new ViolationLogAdapter(this, list);
		hlv.setAdapter(adapter);
		
		
		showProgress(true);
		queryViolationLogDao.getQueryViolationLog();
		ivBack.setOnClickListener(this);
		ivRightRefresh.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.iv_back:
			finish();
			break;
		case R.id.iv_log_right_refresh:
			T.showShort(this, "刷新");
			break;
		}
	}
}
